package com.woniuxy.stage3demo.mapper.kang;

import com.woniuxy.stage3demo.bean.kang.FraudEngineBean;
import com.woniuxy.stage3demo.pageHelper.PageRequest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface FraudEngineMapper {

    /**
     * 新增
     * @param fraudEngineBean
     * @return
     */
    @Insert("insert into fraud_engine (fraud_no,event,start_time,end_time,use_status,del_flag,fraud_category) values " +
            " (#{f.fraudNo},#{f.event},#{f.startTime},#{f.endTime},0,0,#{f.fraudCategory})")
    int addFraudEngine(@Param("f") FraudEngineBean fraudEngineBean);

    /**
     * 删除
     * @param id
     * @return
     */
    @Update("update fraud_engine set del_flag = 1 where id = #{id}")
    int delFraudEngine(@Param("id") Long id);

    /**
     * 修改
     * @param fraudEngineBean
     * @return
     */
    int modFraudEngine(@Param("f") FraudEngineBean fraudEngineBean);

    /**
     * 分页查询
     * @param pageRequest
     * @return
     */
    List<FraudEngineBean> findLimit(@Param("p") PageRequest pageRequest,@Param("f") FraudEngineBean fraudEngineBean);

}
